package algorithmTopics.designPatterns.adapterPattern;

/**
 * 音频播放器
 *
 * @author 86155
 * @date 2025/07/22
 */
public class AudioPlayer implements MediaPlayer{

    MediaAdapter mediaAdapter;

    @Override
    public void play(String audioType, String fileName) {
        if (audioType.equalsIgnoreCase("mp3")) {
            System.out.println("mp3 file . name" + fileName);
        } else if (audioType.equalsIgnoreCase("mp4") ||
                audioType.equalsIgnoreCase("lvc")) {
            mediaAdapter = new MediaAdapter(audioType);
            mediaAdapter.play(audioType,fileName);
        } else {
            System.out.println("invalid media");
        }
    }
}
